package com.sasac.test.api;

import com.sasac.common.core.domain.R;
import com.sasac.common.core.web.controller.BaseController;
import com.sasac.common.core.web.domain.AjaxResult;
import com.sasac.common.security.annotation.PreAuthorize;
import com.sasac.test.api.model.TestDTO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

@RestController
@RequestMapping("/api/my")
public class MyApiController extends BaseController {

    @GetMapping("/test")
    public R<TestDTO> list(@PathParam("name") String name) {
        TestDTO testDTO = new TestDTO();
        testDTO.setId(111L);
        testDTO.setName(name + "的测试！");
        return R.ok(testDTO);
    }
}
